<?php
// 指定允许其他域名访问
if(isset($_SERVER['HTTP_ORIGIN'])) header('Access-Control-Allow-Origin:'.$_SERVER['HTTP_ORIGIN']);
// 响应类型  
header('Access-Control-Allow-Methods:POST');  
// 响应头设置  
header('Access-Control-Allow-Headers:x-requested-with,content-type');
header("Access-Control-Allow-Credentials: true");
if(isset($_GET['url'])){
    include 'phpqrcode.php';
    $value = $_GET['url']; //二维码内容
    $errorCorrectionLevel = 'L';//容错级别
    $matrixPointSize = 10;//生成图片大小
    //生成二维码图片
    QRcode::png($value, false, $errorCorrectionLevel, $matrixPointSize, 0);
}
?>